{% extends 'insight/layout.html' %}
{% block title %}换电站列表{% endblock %}
{% block content %}
<div class="container">
    <div class="row">
        <div class="col" align="center">
            <h2>换电站列表</h2>
            <div align="right"><a role="button" class="btn btn-info" href="/station_create/">新增</a></div>
            <table class="table table-striped">
                <thead>
                        <tr>
                            <th>换电站名称</th>
                            <th>换电站编号</th>
                            <th>事业部</th>
                            <th>换电站厂家</th>
                            <th>换电站型号</th>
                            <th>换电机器人</th>
                            <th>驱动形式</th>
                            <th>机器人行走方向</th>
                            <th>电机数量</th>
                        </tr>
                    </thead>
                    <tbody>
                    {% if stations %}
                        {% for station in stations %}
                        <tr>
                            <td><a href="/station/{{ station.station_id }}/">{{ station.station_name }}</a></td>
                            <td>{{ station.station_id }}</td>
                            <td>{{ station.business_unit }}</td>
                            <td>{{ station.station_maker }}</td>
                            <td>{{ station.station_type.station_model }}</td>
                            <td>{{ station.robot_type.robot_type }}</td>
                            <td>{{ station.drive_type }}</td>
                            <td>{{ station.robot_direction }}</td>
                            <td>{{ station.motor_count }}</td>
                        </tr>
                        {% endfor %}
                    {% else %}
                        <p>No stations are available.</p>
                    {% endif %}
                    </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock %}